<script src="<?=base_url(); ?>theme/js/main.js"></script>
<script type="text/javascript">
                                                            
$(document).ready(function(){
$('.table_top').hide(); //Oculta la parte de búsqueda por defecto de la tabla de productos .
});

</script>
<div class="grid_container">
        <div class="grid_12">
                <div class="widget_wrap">
                        <div class="widget_top">
                                <span class="h_icon clipboard"></span>
                                <h6>Listado de Productos</h6>
                        </div>
                        <div class="form_container">
                                <ul>
                                        <li>
                                                <div class="form_grid_12">
                                                        <div class="form_input">
                                                        <form method="post" action="">
                                                                <div class="form_grid_2 alpha">
                                                                        <input name="code" type="text" value="<?php echo $code; ?>">
                                                                        <span class=" label_intro">Código</span>
                                                                </div>
                                                                <div class="form_grid_5 ">
                                                                        <input name="description" type="text" value="<?php echo $description; ?>">
                                                                        <span class=" label_intro">Descripción</span>
                                                                </div>
                                                                <div class="form_grid_3 ">
                                                                        <input name="category" type="text" value="<?php echo $category; ?>">
                                                                        <span class=" label_intro">Categoria</span>
                                                                </div>
                                                                <div class="form_grid_2 ">
                                                                <input type="submit" class="btn_small btn_blue" value="Buscar">
                                                                </div>
                                                                <span class="clear"></span>
                                                        </form>
                                                        </div>
                                                </div>
                                        </li>
                                </ul>
                        </div>
                        <div class="widget_content">
                                <table class="display data_tbl">
                                        <thead>
                                                <tr>
                                                        <th>Código</th>
                                                        <th>Descripción</th>
                                                        <th>Precio</th>
                                                        <th>Unidad Medida</th>
                                                        <th>Opciones</th>
                                                </tr>
                                        </thead>
                                        <tbody>
                                        <?php $i = 0; ?>
                                        <?php foreach ($products as $p) : ?>
                                            <?php $i++; ?>
                                                <tr class="<?=($i%2==0) ? "tr_even" : "tr_odd" ?>">
                                                        <td><?=$p->code; ?></td>
                                                        <td><?=$p->description; ?></td>
                                                        <td align="right">US$ <?=$p->price; ?></td>
                                                        <td align="center"><?=$p->pack_desc; ?></td>
                                                        <td align="center">                                                        
                                                           <a class="action-icons c-edit" href="<?php echo base_url(); ?>index.php/products/edit/<?php echo $p->products_id; ?>" original-title="Editar">Editar</a>
                                                            <a class="action-icons c-Delete" href="javascript:confirmar_borrar('<?php echo base_url(); ?>index.php/products/delete/<?php echo $p->products_id; ?>')" original-title="Borrar">Borrar</a>
                                                        </td>
                                                </tr>
                                        <?php endforeach; ?>
                                        </tbody>
                                </table>
                        </div>
                </div>
        </div>
        <span class="clear"></span>
</div>